package com.tianzhu.repositories;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.tianzhu.domain.Customer;

public interface CustomerRepo extends JpaRepository<Customer, Long> {

	@Query(value="select CUSTOMER.* from CUSTOMER join USERS on CUSTOMER.ID=USERS.CUSTOMERID where USERS.USERNAME = :username",nativeQuery=true)
	Customer findCustomerByUsername(@Param("username") String username);
	
}
